import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { TestTeachScheduleVO, TestTeachScheduleForm, TestTeachScheduleQuery } from '@/api/core/testTeachSchedule/types';

/**
 * 查询教学实验排课日历
 * @param query
 * @returns {*}
 */

export const listTestTeachScheduleCard = (query?: TestTeachScheduleQuery): AxiosPromise<TestTeachScheduleVO[]> => {
  return request({
    url: '/core/testTeachSchedule/table',
    method: 'get',
    params: query
  });
};

/**
 * 查询教学实验排课列表
 * @param query
 * @returns {*}
 */

export const listTestTeachSchedule = (query?: TestTeachScheduleQuery): AxiosPromise<TestTeachScheduleVO[]> => {
  return request({
    url: '/core/testTeachSchedule/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询教学实验排课详细
 * @param id
 */
export const getTestTeachSchedule = (id: string | number): AxiosPromise<TestTeachScheduleVO> => {
  return request({
    url: '/core/testTeachSchedule/' + id,
    method: 'get'
  });
};

/**
 * 新增教学实验排课
 * @param data
 */
export const addTestTeachSchedule = (data: TestTeachScheduleForm) => {
  return request({
    url: '/core/testTeachSchedule',
    method: 'post',
    data: data
  });
};

/**
 * 修改教学实验排课
 * @param data
 */
export const updateTestTeachSchedule = (data: TestTeachScheduleForm) => {
  return request({
    url: '/core/testTeachSchedule',
    method: 'put',
    data: data
  });
};

/**
 * 删除教学实验排课
 * @param id
 */
export const delTestTeachSchedule = (id: string | number | Array<string | number>) => {
  return request({
    url: '/core/testTeachSchedule/' + id,
    method: 'delete'
  });
};
/**
 * 查询二维码 
 * @param courseId
 */
 export const qrCode = (query) => {
  return request({
    url: '/app/course/qrCode',
    method: 'get',
    params: query
  });
};